{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Planning refreshment production\n", "A firm that packs refreshments employs the same syrup to produce its 1.5 l COLI and PEPSA products on its S1 production line. Once processed, each hectolitre of syrup produces 40 units of the 1.5 l COLI product or 20 units of the 1.5 l PEPSA product. If $x_1$ units of the 1.5 l COLI product and $x_2$ units of the 1.5 l PEPSA product are produced, the firm estimates that the daily income obtained in dollars would be given by the following function:\n", "\n", "$f(x) = 49000·x_1 -x_1^2 + 30·x_2 -2·x_2^2$\n", "\n", "It costs 150 dollars to buy and process each hectolitre of syrup. The S1 packaging line has a net capacity of producing 56,800 1.5 l product units every day. The firm is committed to produce at least half the amount of PEPSA than COLI. Although priority orders tend to amend its production planning, the firm wishes to have a basic product planning that optimises its daily profits.\n", "\n", "**a)** Formulate a non-linear programming model that helps the firm create its basic daily product planning for its S1 packaging line.\n", "Our decision variables are: \n", "\n", "- $x_1$: Units of COLI\n", "- $x_2$: Units of PEPSA\n", "\n", "The objective is to maximise the profits, so we need to calculate the difference between the revenues and the costs: \n", "\n", "$\\max z = f(x)-c(x)$\n", "\n", "Let us first consider the costs as a function of the number of hectolitres of syrup used ($h_l$): \n", "\n", "$c = 150*h_l$\n", "\n", "$h_l = x_1/40 + x_2/20$\n", "\n", "If we define the cost as a function of $x=[x_1,x_2]$, then:\n", "\n", "$c(x) = 150·(x_1/40 + x_2/20)$\n", "\n", "Now, z becomes:\n", "\n", "$z = 49000·x_1 -x_1^2 + 30·x_2 -2·x_2^2 - 3.75·x_1 -7.5·x_2$\n", "\n", "As for the constraints, the capacity cannot exceed the total capacity of the line:\n", "\n", "$x_1 + x_2 \\leq 56800$\n", "\n", "And the \n", "\n", "$z = 48996.25x_1 - x_1^2 + 22.5·x_2 - 2x_2^2$\n", "\n", "$s.t$\n", "\n", "$x_1 + x_2 \\leq 56800$\n", "\n", "$x_2 \\geq x_1/2$\n", "\n", "Or in canonical form: \n", "\n", "$z = 48996.25x_1 - x_1^2 - 22.5·x_2- 2x_2^2$\n", "\n", "$s.t.$ \n", "\n", "$x_1 + x_2 -56800 \\leq 0$ \n", "\n", "$x_1 - 2x_2 \\leq 0$\n", "\n", "$x_1, x_2 \\geq 0$\n", "\n", "\n", "**b)** Write down the Kuhn Tucker conditions that would help the company determine the basic daily production plan.\n", "\n", "The Lagrangian is:\n", "\n", "$L = 48996.25x_1 - x_1^2 - 22.5·x_2- 2x_2^2 + \\lambda_1\\left(x_1 + x_2 -56800\\right) + \\lambda_2\\left(x_1/2 - x_2\\right)$\n", "\n", "**Gradient condition:**\n", "\n", "$\\nabla(L)=0$\n", "\n", "$\\dfrac{dL}{dx_1} = 48996.25-2x_1+\\lambda_1+\\lambda_2 = 0$\n", "\n", "$\\dfrac{dL}{dx_2} = 22.5-4x_2+\\lambda_1-\\lambda_2 = 0$\n", "\n", "**Feasibility Condition:**\n", "\n", "$x_1 + x_2 -56800 \\leq 0$\n", "\n", "$x_1 - 2x_2 \\leq 0$\n", "\n", "**Orthogonality Condition:**\n", "\n", "$\\lambda_1·(x_1 + x_2 -56800) = 0$\n", "\n", "$\\lambda_2·(x_1 - 2x_2) = 0$\n", "\n", "**Non-negativity condition:**\n", "\n", "$x_1, x_2, \\geq 0$\n", "\n", "$\\lambda_1, \\lambda_2 \\leq 0$\n", "\n", "\n", "**c)** The following critical point is found $x_1= 13838.33; x_2= 6919.16; \\lambda_1=0; \\lambda_2=-15323.34; z = 287249204.2$, where $\\lambda_1$ is the Lagrangian multiplier corresponding to the S1 packaging line capacity constraint. Can you conclude whether it is a local/global maximum? With this solution, What is the maximum quantity that the firm would be willing to pay for 1 h of overtime production? How much would the daily profit increase per additional COLI unit produced?\n", "\n", "The Hessian matrix is: \n", "\n", "$H = \\begin{bmatrix}\n", "-2 & 0\\\\\n", "0 & -4\n", "\\end{bmatrix}$\n", "\n", "The Hessian determinants are: \n", "\n", "$H_1 = -2$\n", "\n", "$H_2 = 8$\n", "\n", "Since the determinants have alternating signs, the Hessian is negative definite, confirming that the critical point is a local maximum.\n", "\n", "In this Kuhn-Tucker point, the $\\lambda_1$ is the shadow price of the constraint representing the net capacity and is equal to zero, meaning that the capacity is not binding the profit, and it is not profitable for the company to increase it with extra hours.\n", "On the other hand, the shadow price of the second constraint is $\\lambda_2$ is -15323.34, meaning that a unitary change of the function $g_2$ increases the objective function in 15323.34. Since $x_1$ (COLI) is directly proportional to $g_2(x)$, a positive change on the right hand side would increase the profit in 15323.34. Since changes in $x_2$ are multiplied by a factor of -2 in the second constraint, a unitary change of $x_2$ (PEPSA) would decrease the profit in 7661.67." ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.4" }, "pycharm": { "stem_cell": { "cell_type": "raw", "source": [], "metadata": { "collapsed": false } } } }, "nbformat": 4, "nbformat_minor": 2 }